package com.xhwl.data.config;

import com.xhwl.common.pojo.cent.sdata.Enterprise;
import com.xhwl.data.service.IEnterpriseService;
import com.xhwl.starter.config.IConfigDataSourceWrapper;
import com.xhwl.common.pojo.cent.ParameterConfig;
import com.xhwl.common.pojo.cent.sdata.Project;
import com.xhwl.common.pojo.criteria.ParamConfigCriteria;
import com.xhwl.data.service.IParameterConfigService;
import com.xhwl.data.service.IProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: luyi
 * @Description:
 * @Date: Create in 11:36 2020/12/14
 */
@Component
public class ParamConfig implements IConfigDataSourceWrapper {

    @Autowired
    private IProjectService projectService;
    @Autowired
    private IEnterpriseService enterpriseService;
    @Autowired
    private IParameterConfigService parameterConfigService;

    @Override
    public ParameterConfig findParamByCriteria(ParamConfigCriteria criteria) {
        return parameterConfigService.findByCriteria(criteria);
    }

    @Override
    public Project findProjectById(Integer projectId) {
        return projectService.findById(projectId);
    }

    @Override
    public Enterprise findEnterpriseById(Integer enterpriseId) {
        return enterpriseService.findById(enterpriseId);
    }
}
